#pragma once

////#include <vld.h>

#include "BeanieIncludes.h"
#include "BeanieDefines.h"
#include "BeanieEnums.h"

#include "WindowFramework.h"

#include "BeanieCamera.h"
#include "BeanieTexture.h"
#include "D3DFTexture.h"

#include "List.h"
#include "Vector2D.h"

//Direct3D Framework
class Direct3DFramework
{
public:
	//attributes & members
	WindowFramework*		m_window;

	LPDIRECT3D9				m_object;
	LPDIRECT3DDEVICE9		m_device;

	LPD3DXSPRITE			m_sprite;
	LPD3DXFONT				m_font;
	LPD3DXLINE				m_line;

	D3DPRESENT_PARAMETERS	m_present;
	D3DDISPLAYMODE			m_display;
	D3DCAPS9				m_capability;

	BeanieCamera			m_camera;
	List<D3DFTexture*>		m_textureList;

	//ctor & dtor
	Direct3DFramework();
	~Direct3DFramework();

	//init functions
	int init(WindowFramework* a_window);

	//release functions
	int release();

	//create functions
	int createTexture(BeanieTexture* a_texture, char* a_filePath);

	//update functions
	int updateCamera(BeanieCamera* a_camera);
	int updateTransform(BeanieTexture* a_texture,
		V2DF a_transform, V2DF a_scale, float a_rotate);

	//draw functions
	int drawBegin();
	int drawEnd();

	int drawLine(V2DF a_start, V2DF a_end, int m_color);
	int drawText(char* a_text, V2DF a_pos, int a_color);
	int drawTexture(BeanieTexture* a_texture);
};